fix: tab selection not working for integrations#2906
Conversation
Console (appwrite/console)Project ID: Tip Global CDN and DDoS protection come free with every Sites deployment |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
WalkthroughRefactors a Svelte layout component: updates the module script declaration, imports Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR fixes integration tab selection by replacing a local Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["URL pathname changes"] --> B["isTabSelected called for each tab"]
B --> C{tab.hasChildren?}
C -- No --> D["tab.href === pathname?"]
D -- Yes --> E["selected = true"]
D -- No --> F["selected = false"]
C -- Yes --> G{tab.href === pathname?}
G -- Yes --> E
G -- No --> H{tab.href === basePath?}
H -- Yes --> I{any other tab\nmatches pathname?}
I -- No --> J["pathname.includes(tab.href)"]
J --> K["selected = true/false"]
I -- Yes --> L["selected = undefined (fallthrough)"]
H -- No --> M["pathname.includes(tab.href)"]
M --> K
L -. "never reached\nfor these tabs" .-> N["platforms / api-keys /\ndev-keys hrefs ≠ basePath"]
Last reviewed commit: e1a184a |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/routes/`(console)/project-[region]-[project]/overview/+layout.svelte:
- Around line 77-113: The $registerCommands call inside the $effect returns a
cleanup function that must be returned to avoid accumulating duplicate commands;
capture that return value (e.g., const unregister = $registerCommands(...)) and
return it from the $effect so the commands are unregistered when the effect
re-runs or cleans up, while keeping the existing $updateCommandGroupRanks call
(references: $effect, $registerCommands, $updateCommandGroupRanks, and the
command objects for 'Add platform'/'Create API Key'/'Create Dev Key').
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1ccaa606-f6bc-407d-95f9-2bb3dba40c41
📒 Files selected for processing (1)
src/routes/(console)/project-[region]-[project]/overview/+layout.svelte
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

What does this PR do?
Fixes: #2909
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)
Summary by CodeRabbit